//
//  DataManager.h
//  DataManager
//
//  Created by Michael Hinds on 2/25/09.
//  Copyright 2009 University of Arkansas. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "JSON/JSON.h"

@interface DataManager : NSObject
{
	SBJSON *parser;
	
	NSString *userID;
	
	NSString *remoteKey;
	
	NSURLConnection *connection;
	
	NSMutableData *data;
	
	//The view returned by the getImage method to which the image is added
	//inside the didFinishLoading method 
	UIView *imageView;
	
	//determines which method is using the network, so we know how 
	//the connectionDidFinishLoading method should respond
	NSString *caller;	
}

@property(nonatomic, retain) SBJSON *parser;
@property(nonatomic, assign) NSString *userID;
@property(nonatomic, retain) NSString *remoteKey;
@property(nonatomic, assign) NSURLConnection *connection;
@property(nonatomic, retain) NSMutableData *data;
@property(nonatomic, retain) UIView *imageView;
@property(nonatomic, retain) NSString *caller;

-(id) init;
-(id) initWithRemoteKey:(NSString *) rKey AndUserID:(NSString *) uID;
-(NSDictionary *) getPortfolio;
-(NSDictionary *) getWatchlist;
-(NSDictionary *) getPendingOrders;
-(NSDictionary *) getUser;
-(NSDictionary *) getWall;
-(NSDictionary *) getWallForStock:(NSString *) ticker;
-(NSDictionary *) getPerformance:(NSString *) from;
-(NSDictionary *) getSecurity:(NSString *) ticker;
-(void) trade:(NSString *) symbol By:(NSString *) action And:(NSString *) type For:(NSString *) quantity If:(NSString *) limit By:(NSString *) endOfDay;
-(void) addToWatchList:(NSString *) ticker;
-(void) removeFromWatchList:(NSString *) ticker;



@end
